package com.craftplay.dao;

import static org.apache.ibatis.jdbc.SqlBuilder.BEGIN;
import static org.apache.ibatis.jdbc.SqlBuilder.INSERT_INTO;
import static org.apache.ibatis.jdbc.SqlBuilder.SQL;
import static org.apache.ibatis.jdbc.SqlBuilder.VALUES;

import com.craftplay.model.ScopeInfo;

public class ScopeInfoSqlProvider {

    public String insertSelective(ScopeInfo record) {
        BEGIN();
        INSERT_INTO("scope_info");
        
        if (record.getId() != null) {
            VALUES("id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getMainScope() != null) {
            VALUES("main_scope", "#{mainScope,jdbcType=VARCHAR}");
        }
        
        if (record.getSubScope() != null) {
            VALUES("sub_scope", "#{subScope,jdbcType=VARCHAR}");
        }
        
        return SQL();
    }
}